Skip to content

RichText: Format boundaries without DOM - #13697

Merged
ellatrix merged 43 commits into
masterfrom
try/boundaries-2
Feb 8, 2019
Merged

ellatrix merged 43 commits into
masterfrom
try/boundaries-2

Conversation

@ellatrix

@ellatrix ellatrix commented Feb 6, 2019 •

Copy link
Copy Markdown
Member

Description

This PR adds boundary logic to the Rich Text package. Every format will now have boundaries, not just some registered element tags.

Fixes 10 known bugs: closes #13153, closes #12973, closes #12978, closes #11091, closes #11178, closes #11276, closes #12529, closes #11741, closes #11423, closes #11812.

How has this been tested?

See e2e.

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Avoid flickering by setting boundary class when creating the DOM tree

* Remove TinyMCE boundaries

* Remove TinyMCE so it doesn't interfere with our boundaries

* Fix failing unit tests

* Only have one boundary class at a time

* Remove filterString param

* Build in own padding and boundary classes

* Update styling

* valueToFormat shouldn't create editable tree

* Add zero with spaces around formatting

* Remove old boundary compatibility code

* Update dom diff, prevent browser selection overwrite on boundary

* Update UI

* Fix inserting format with shortcut

* Add check

* Remove nbsp inserted by TinyMCE from test

* Do not mutate attirbutes object

* Fix link e2e tests

* WIP

* WIP: try boundaries without DOM

* Remove zero width space everywhere

* Fix e2e tests

* Clean up

* Revert selection snapshots

* Correctly remove dependencies

* Add nested boundary test

* Add backtick test

* Fix annotation tests: they now have boundaries

* Merge logic

* Fix getActiveFormat test

* Update some docs and dependencies

* Fix block CSS

* Return focus to editable after pressing format button

* Update docs

* Update changelogs

* Add changelog headings

* Remove obsolete onFocus class method from Editable

* Restore :focus

* Update TinyMCE mentions

* Use Escape instead of mouse move

* Update isHorizontalEdge comment

* Add docs for fromFormat

* Create test content manually
This was referenced Apr 30, 2020
desrosj added a commit to desrosj/gutenberg that referenced this pull request Oct 20, 2026
`undo › should undo typing after non input change` types "after keyboard"
into a bold format and compares the post content with a snapshot. The
snapshot has a non-breaking space between the two words, but this branch's
rich text now produces a regular space, so the snapshot never matches.

`trunk` updated the same snapshot to a regular space in WordPress#13697, which changed
how format boundaries are handled. Do the same here.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SRW6hV7j7bc8cxt2LUbPJt
desrosj added a commit to desrosj/gutenberg that referenced this pull request Oct 20, 2026
`undo › should undo typing after non input change` types "after keyboard"
into a bold format and compares the post content with a snapshot. The
snapshot has a non-breaking space between the two words, but this branch's
rich text now produces a regular space, so the snapshot never matches.

`trunk` updated the same snapshot to a regular space in WordPress#13697, which changed
how format boundaries are handled. Do the same here.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SRW6hV7j7bc8cxt2LUbPJt
desrosj added a commit to desrosj/gutenberg that referenced this pull request Oct 21, 2026
`undo › should undo typing after non input change` types "after keyboard"
into a bold format and compares the post content with a snapshot. The
snapshot has a non-breaking space between the two words, but this branch's
rich text now produces a regular space, so the snapshot never matches.

`trunk` updated the same snapshot to a regular space in WordPress#13697, which changed
how format boundaries are handled. Do the same here.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SRW6hV7j7bc8cxt2LUbPJt
desrosj added a commit to desrosj/gutenberg that referenced this pull request Oct 26, 2026
`undo › should undo typing after non input change` types "after keyboard"
into a bold format and compares the post content with a snapshot. The
snapshot has a non-breaking space between the two words, but this branch's
rich text now produces a regular space, so the snapshot never matches.

`trunk` updated the same snapshot to a regular space in WordPress#13697, which changed
how format boundaries are handled. Do the same here.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SRW6hV7j7bc8cxt2LUbPJt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Package] Rich text /packages/rich-text

Projects

None yet

6 participants